#include <bits/stdc++.h>

#define int long long

using namespace std;

void solve()
{
    int n,k;
    cin >> n >> k;
    string s;
    cin >> s;
    int maxlen = 0;
    int len = 0;
    for(int i = 0; i < s.size(); i ++)
    {
        if(s[i] == '1')
        {
            len ++;
        }
        else
        {
            maxlen = max(maxlen,len);
            len = 0;
        }
    }
    maxlen = max(maxlen,len);

    if(maxlen >= k)
    {
        cout << "No" << endl;
        return;
    }
    cout << "Yes" << endl;

    int left = n;
    int right = 1;

    for(int i = 0; i <= n - 1; i ++)
    {
        if(s[i] == '0')
        {
            cout << left << ' ';
            left --;
        }
        else 
        {
            cout << right << ' ';
            right ++;
        }
    }

    cout << endl;
}

signed main()
{
    int t;
    cin >> t;
    while(t --)
    {
        solve();
    }
}